import { useState } from 'react';

export const useBool = (initValue = false) => {
  const [state, setState] = useState(initValue);

  const toggle = () => {
    setState(!state);
  };

  const on = () => {
    setState(true);
  };

  const off = () => {
    setState(false);
  };

  return { state, toggle, on, off };
};